//
//  EXRCell.m
//  HuiKaoClient
//
//  Created by 龚 杰 on 13-2-26.
//  Copyright (c) 2013年 龚 杰. All rights reserved.
//

#import "EXRCell.h"

@implementation EXRCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        m_View = [[UIView alloc] initWithFrame:CGRectMake(12,16,590/2,228/2)];
        [m_View setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"recommend_background_red.png"]]];
        

        m_title = [[UILabel alloc] initWithFrame:CGRectMake(15,10,100,20)];
        m_title.backgroundColor = [UIColor clearColor];
        m_title.font = [UIFont boldSystemFontOfSize:16.0f];
        m_title.textColor = [UIColor blackColor];
        

        m_number = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];
        m_number.backgroundColor = [UIColor clearColor];
        m_number.font = [UIFont boldSystemFontOfSize:70.0f];
        m_number.textColor = [UIColor colorWithRed:223/250.f green:19/255.0f blue:33/255.0f alpha:1.0];
        
        m_day = [[UILabel alloc] initWithFrame:CGRectMake(320-60,114-32,20,20)];
        m_day.backgroundColor = [UIColor clearColor];
        m_day.font = [UIFont boldSystemFontOfSize:20.0f];
        m_day.text = @"天";
        m_day.textColor = [UIColor blackColor];
        
        m_image = [[UIImageView alloc] initWithFrame:CGRectMake(20, 50, 44, 48)];
        [m_image setImage:[UIImage imageNamed:@"clock.png"]];
        
        [m_View addSubview:m_title];
        [m_View addSubview:m_number];
        [m_View addSubview:m_day];
        [m_View addSubview:m_image];
        [self.contentView addSubview:m_View];
    }
    return self;
}

- (void)setData:(NSString*)_title number:(NSString*)_number
{
    CGSize iSize = [_title sizeWithFont:[UIFont boldSystemFontOfSize:16.0f]];
    m_title.frame = CGRectMake(15,10,iSize.width,iSize.height);
    m_title.text = _title;
    CGSize iSize1 = [_number sizeWithFont:[UIFont boldSystemFontOfSize:70.0f]];
    m_number.frame = CGRectMake(320-iSize1.width - 60 ,35,iSize1.width,iSize1.height);
    m_number.text = _number;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)dealloc
{
    [m_View release];
    [m_title release];
    [m_number release];
    [m_day release];
    [m_image release];
    [super dealloc];
}
@end
